package com.emep.emeptime.controller;

import com.emep.emeptime.service.aqi.AqiNumberOfMonthsService;
import com.emep.emeptime.utils.DateUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.ParseException;
import java.util.Map;

/**
 * @author: LFY
 * @version:V1.0
 * @Description:
 * @Date: 2018/8/8 11:02
 */


@Component
@Slf4j
public class AqiNumberOfMonthController {

    @Autowired
    private AqiNumberOfMonthsService aqiNumberOfMonthsService;

    /**
     *优良天数，重污染天数，pm2.5已达数值 每天晚上23点57执行
     */
    @Scheduled(cron = "0 05 03 * * ?")
    public void time() throws ParseException {
        log.info("*******************  优良天数，重污染天数，pm2.5已达数值  开始时间：{}", DateUtils.getNowTime());
        aqiNumberOfMonthsService.save();
    }
}
